<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\Config */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="config-form">

    <?php $form = ActiveForm::begin(); ?>
    <div class="row">
        <div class="col-md-6">
            <?= $form->field($model, 'cid')->textInput()->dropDownList(['1' => '基本设置', '2' => 'seo']) ?>

            <?= $form->field($model, 'type')->textInput(['maxlength' => true])->dropDownList(['text' => '文字', 'img' => '图片']); ?>

            <?= $form->field($model, 'key')->textInput(['maxlength' => true]) ?>

            <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

            <?= $form->field($model, 'value')->textInput(['maxlength' => true]) ?>

            <div class="form-group">
                <?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
            </div>
        </div>
        <div class="col-md-6">
            <?= $form->field($model, 'remark')->textInput(['maxlength' => true]) ?>

            <?php if(!$model->sort){ ?>
                <?= $form->field($model, 'sort')->textInput(['value' => 0]) ?>
            <?php }else{ ?>
                <?= $form->field($model, 'sort')->textInput(['value' => $model->sort]) ?>
            <?php }?>
        </div>
    </div>


    <?php ActiveForm::end(); ?>

</div>
